<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::IndexBinary Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><a class="el" href="structfaiss_1_1IndexBinary.html">IndexBinary</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structfaiss_1_1IndexBinary-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::IndexBinary Struct Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="IndexBinary_8h_source.html">IndexBinary.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for faiss::IndexBinary:</div>
<div class="dyncontent">
 <div class="center">
  <img src="structfaiss_1_1IndexBinary.png" usemap="#faiss::IndexBinary_map" alt=""/>
  <map id="faiss::IndexBinary_map" name="faiss::IndexBinary_map">
<area href="classfaiss_1_1gpu_1_1GpuIndexBinaryFlat.html" alt="faiss::gpu::GpuIndexBinaryFlat" shape="rect" coords="0,56,182,80"/>
<area href="structfaiss_1_1IndexBinaryFlat.html" alt="faiss::IndexBinaryFlat" shape="rect" coords="192,56,374,80"/>
<area href="structfaiss_1_1IndexBinaryFromFloat.html" alt="faiss::IndexBinaryFromFloat" shape="rect" coords="384,56,566,80"/>
<area href="structfaiss_1_1IndexBinaryHNSW.html" alt="faiss::IndexBinaryHNSW" shape="rect" coords="576,56,758,80"/>
<area href="structfaiss_1_1IndexBinaryIVF.html" alt="faiss::IndexBinaryIVF" shape="rect" coords="768,56,950,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a01749bbdbd3b7ec6bb9390257ab16c5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01749bbdbd3b7ec6bb9390257ab16c5c"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> = <a class="el" href="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">Index::idx_t</a></td></tr>
<tr class="memdesc:a01749bbdbd3b7ec6bb9390257ab16c5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">all indices are this type <br/></td></tr>
<tr class="separator:a01749bbdbd3b7ec6bb9390257ab16c5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa0f338d22575d508cd6141972addaa6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa0f338d22575d508cd6141972addaa6"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>component_t</b> = uint8_t</td></tr>
<tr class="separator:aaa0f338d22575d508cd6141972addaa6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af958aa9b51dac1fcc433014959cad20c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af958aa9b51dac1fcc433014959cad20c"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>distance_t</b> = int32_t</td></tr>
<tr class="separator:af958aa9b51dac1fcc433014959cad20c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2a76f22851e42963b6a42c6d39e93b4b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2a76f22851e42963b6a42c6d39e93b4b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>IndexBinary</b> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> <a class="el" href="structfaiss_1_1IndexBinary.html#a0e485a7189eec2675032486d3b12cf88">d</a>=0, <a class="el" href="namespacefaiss.html#afd12191c638da74760ff397cf319752c">MetricType</a> metric=METRIC_L2)</td></tr>
<tr class="separator:a2a76f22851e42963b6a42c6d39e93b4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34b7f0f358259d858135555967c6bc79"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a34b7f0f358259d858135555967c6bc79">train</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x)</td></tr>
<tr class="separator:a34b7f0f358259d858135555967c6bc79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af04b1093cdebfea189e0e04da68794d7"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#af04b1093cdebfea189e0e04da68794d7">add</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x)=0</td></tr>
<tr class="separator:af04b1093cdebfea189e0e04da68794d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68a24abdf241eb98372b7d6fbd8d3891"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a68a24abdf241eb98372b7d6fbd8d3891">add_with_ids</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x, const long *xids)</td></tr>
<tr class="separator:a68a24abdf241eb98372b7d6fbd8d3891"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48cdd06037d1fb8ce827e7522ba05fb8"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a48cdd06037d1fb8ce827e7522ba05fb8">search</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> k, int32_t *distances, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *labels) const =0</td></tr>
<tr class="separator:a48cdd06037d1fb8ce827e7522ba05fb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adec414108d34c63e4a06b6d3f9a3fa35"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#adec414108d34c63e4a06b6d3f9a3fa35">range_search</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x, int radius, <a class="el" href="structfaiss_1_1RangeSearchResult.html">RangeSearchResult</a> *result) const </td></tr>
<tr class="separator:adec414108d34c63e4a06b6d3f9a3fa35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27c32414471c57138b248583fc0c5f8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a27c32414471c57138b248583fc0c5f8c">assign</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *labels, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> k=1)</td></tr>
<tr class="separator:a27c32414471c57138b248583fc0c5f8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11bff8bcaa366c563076a3d18f3ae30c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11bff8bcaa366c563076a3d18f3ae30c"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a11bff8bcaa366c563076a3d18f3ae30c">reset</a> ()=0</td></tr>
<tr class="memdesc:a11bff8bcaa366c563076a3d18f3ae30c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all elements from the database. <br/></td></tr>
<tr class="separator:a11bff8bcaa366c563076a3d18f3ae30c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2b85e2cad27acb06cb9d6d8e600ae02"><td class="memItemLeft" align="right" valign="top">virtual long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#ae2b85e2cad27acb06cb9d6d8e600ae02">remove_ids</a> (const <a class="el" href="structfaiss_1_1IDSelector.html">IDSelector</a> &amp;sel)</td></tr>
<tr class="separator:ae2b85e2cad27acb06cb9d6d8e600ae02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60180e1c6b363c287b6e55191455a82f"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a60180e1c6b363c287b6e55191455a82f">reconstruct</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> key, uint8_t *recons) const </td></tr>
<tr class="separator:a60180e1c6b363c287b6e55191455a82f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5885ba0cbd91cf6c5fe2f53bb5650c3"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#ab5885ba0cbd91cf6c5fe2f53bb5650c3">reconstruct_n</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> i0, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> ni, uint8_t *recons) const </td></tr>
<tr class="separator:ab5885ba0cbd91cf6c5fe2f53bb5650c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae99e8745fc02ffac2cfdb431951eeabf"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#ae99e8745fc02ffac2cfdb431951eeabf">search_and_reconstruct</a> (<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> n, const uint8_t *x, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> k, int32_t *distances, <a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *labels, uint8_t *recons) const </td></tr>
<tr class="separator:ae99e8745fc02ffac2cfdb431951eeabf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63d722545b95badd251f3e8770b9bb9b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a63d722545b95badd251f3e8770b9bb9b">display</a> () const </td></tr>
<tr class="separator:a63d722545b95badd251f3e8770b9bb9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a0e485a7189eec2675032486d3b12cf88"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e485a7189eec2675032486d3b12cf88"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a0e485a7189eec2675032486d3b12cf88">d</a></td></tr>
<tr class="memdesc:a0e485a7189eec2675032486d3b12cf88"><td class="mdescLeft">&#160;</td><td class="mdescRight">vector dimension <br/></td></tr>
<tr class="separator:a0e485a7189eec2675032486d3b12cf88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a277c2645b8def11c5d982384098c5380"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a277c2645b8def11c5d982384098c5380"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a277c2645b8def11c5d982384098c5380">code_size</a></td></tr>
<tr class="memdesc:a277c2645b8def11c5d982384098c5380"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of bytes per vector ( = d / 8 ) <br/></td></tr>
<tr class="separator:a277c2645b8def11c5d982384098c5380"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41b6759d127475d5fcd2b3982a8f355e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a41b6759d127475d5fcd2b3982a8f355e"></a>
<a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a41b6759d127475d5fcd2b3982a8f355e">ntotal</a></td></tr>
<tr class="memdesc:a41b6759d127475d5fcd2b3982a8f355e"><td class="mdescLeft">&#160;</td><td class="mdescRight">total nb of indexed vectors <br/></td></tr>
<tr class="separator:a41b6759d127475d5fcd2b3982a8f355e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1656c00d77d55999becd71e3d8ea6dd7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1656c00d77d55999becd71e3d8ea6dd7"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a1656c00d77d55999becd71e3d8ea6dd7">verbose</a></td></tr>
<tr class="memdesc:a1656c00d77d55999becd71e3d8ea6dd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">verbosity level <br/></td></tr>
<tr class="separator:a1656c00d77d55999becd71e3d8ea6dd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a132119ae93e240b54621c5c669853c7f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a132119ae93e240b54621c5c669853c7f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a132119ae93e240b54621c5c669853c7f">is_trained</a></td></tr>
<tr class="memdesc:a132119ae93e240b54621c5c669853c7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">set if the <a class="el" href="structfaiss_1_1Index.html">Index</a> does not require training, or if training is done already <br/></td></tr>
<tr class="separator:a132119ae93e240b54621c5c669853c7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a344529c829717012b530ef9c13b145b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a344529c829717012b530ef9c13b145b7"></a>
<a class="el" href="namespacefaiss.html#afd12191c638da74760ff397cf319752c">MetricType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1IndexBinary.html#a344529c829717012b530ef9c13b145b7">metric_type</a></td></tr>
<tr class="memdesc:a344529c829717012b530ef9c13b145b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">type of metric this index uses for search <br/></td></tr>
<tr class="separator:a344529c829717012b530ef9c13b145b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Abstract structure for a binary index.</p>
<p>Supports adding vertices and searching them.</p>
<p>All queries are symmetric because there is no distinction between codes and vectors. </p>

<p>Definition at line <a class="el" href="IndexBinary_8h_source.html#l00036">36</a> of file <a class="el" href="IndexBinary_8h_source.html">IndexBinary.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af04b1093cdebfea189e0e04da68794d7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void faiss::IndexBinary::add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Add n vectors of dimension d to the index.</p>
<p>Vectors are implicitly assigned labels ntotal .. ntotal + n - 1 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>input matrix, size n * d / 8 </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#aaa0eb1eca49892304ceaa11bd3a5ffa1">faiss::IndexBinaryIVF</a>, <a class="el" href="classfaiss_1_1gpu_1_1GpuIndexBinaryFlat.html#a84b9c07089abd5c0fa8f07a7a22de047">faiss::gpu::GpuIndexBinaryFlat</a>, <a class="el" href="structfaiss_1_1IndexBinaryHNSW.html#aca2c449410d48edb72228016463aed5d">faiss::IndexBinaryHNSW</a>, <a class="el" href="structfaiss_1_1IndexBinaryFromFloat.html#ac4f01196a335a9b2433e5c16396c1fd7">faiss::IndexBinaryFromFloat</a>, and <a class="el" href="structfaiss_1_1IndexBinaryFlat.html#ad2e6f7d9e4672caff89b6045cd2a808a">faiss::IndexBinaryFlat</a>.</p>

</div>
</div>
<a class="anchor" id="a68a24abdf241eb98372b7d6fbd8d3891"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::add_with_ids </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const long *&#160;</td>
          <td class="paramname"><em>xids</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Same as add, but stores xids instead of sequential ids.</p>
<p>The default implementation fails with an assertion, as it is not supported by all indexes.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">xids</td><td>if non-null, ids to store for the vectors (size n) </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#a8f5fc7b1cc59623154f7922459d8c7bb">faiss::IndexBinaryIVF</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00034">34</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a27c32414471c57138b248583fc0c5f8c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::assign </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>k</em> = <code>1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return the indexes of the k vectors closest to the query x.</p>
<p>This function is identical to search but only returns labels of neighbors. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>input vectors to search, size n * d / 8 </td></tr>
    <tr><td class="paramname">labels</td><td>output labels of the NNs, size n*k </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00028">28</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a63d722545b95badd251f3e8770b9bb9b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::display </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Display the actual class name and some more info. </p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00072">72</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="adec414108d34c63e4a06b6d3f9a3fa35"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::range_search </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>radius</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1RangeSearchResult.html">RangeSearchResult</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Query n vectors of dimension d to the index.</p>
<p>return all vectors with distance &lt; radius. Note that many indexes do not implement the range_search (only the k-NN search is mandatory).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>input vectors to search, size n * d / 8 </td></tr>
    <tr><td class="paramname">radius</td><td>search radius </td></tr>
    <tr><td class="paramname">result</td><td>result table </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00023">23</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a60180e1c6b363c287b6e55191455a82f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::reconstruct </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>recons</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reconstruct a stored vector.</p>
<p>This function may not be defined for some indexes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>id of the vector to reconstruct </td></tr>
    <tr><td class="paramname">recons</td><td>reconstucted vector (size d / 8) </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#ad233d3fcf4e001849301c0fbeb675f81">faiss::IndexBinaryIVF</a>, <a class="el" href="classfaiss_1_1gpu_1_1GpuIndexBinaryFlat.html#a9b16b11b5fcc5cc97359e684f5e4a338">faiss::gpu::GpuIndexBinaryFlat</a>, <a class="el" href="structfaiss_1_1IndexBinaryHNSW.html#af509e0e2a6194a270a4887e20f54d866">faiss::IndexBinaryHNSW</a>, and <a class="el" href="structfaiss_1_1IndexBinaryFlat.html#a65c83fa2f2740fc17089e63dc7b70076">faiss::IndexBinaryFlat</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00043">43</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ab5885ba0cbd91cf6c5fe2f53bb5650c3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::reconstruct_n </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>i0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>ni</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>recons</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reconstruct vectors i0 to i0 + ni - 1.</p>
<p>This function may not be defined for some indexes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">recons</td><td>reconstucted vectors (size ni * d / 8) </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#a4a8cd9437b9adc21696aefe1fa440a22">faiss::IndexBinaryIVF</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00047">47</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae2b85e2cad27acb06cb9d6d8e600ae02"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">long faiss::IndexBinary::remove_ids </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structfaiss_1_1IDSelector.html">IDSelector</a> &amp;&#160;</td>
          <td class="paramname"><em>sel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Removes IDs from the index. Not supported by all indexes. </p>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#a06d0e73e7ece9689000f936e7f1e2960">faiss::IndexBinaryIVF</a>, and <a class="el" href="structfaiss_1_1IndexBinaryFlat.html#aabfbe7b0938f28a3eefeeedea4b7b545">faiss::IndexBinaryFlat</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00038">38</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a48cdd06037d1fb8ce827e7522ba05fb8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void faiss::IndexBinary::search </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *&#160;</td>
          <td class="paramname"><em>labels</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Query n vectors of dimension d to the index.</p>
<p>return at most k vectors. If there are not enough results for a query, the result array is padded with -1s.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>input vectors to search, size n * d / 8 </td></tr>
    <tr><td class="paramname">labels</td><td>output labels of the NNs, size n*k </td></tr>
    <tr><td class="paramname">distances</td><td>output pairwise distances, size n*k </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#aeaf24ee802fe8f43879c735c363b6fd5">faiss::IndexBinaryIVF</a>, <a class="el" href="classfaiss_1_1gpu_1_1GpuIndexBinaryFlat.html#aa4d81e853f4194a8b865fcfe7dddd050">faiss::gpu::GpuIndexBinaryFlat</a>, <a class="el" href="structfaiss_1_1IndexBinaryHNSW.html#ae387b8e7094bfe584ef873c377a13af0">faiss::IndexBinaryHNSW</a>, <a class="el" href="structfaiss_1_1IndexBinaryFromFloat.html#af92913a782c65843fbf7a65e017d6f5f">faiss::IndexBinaryFromFloat</a>, and <a class="el" href="structfaiss_1_1IndexBinaryFlat.html#a473e35ebabadc79869ca89f987553b13">faiss::IndexBinaryFlat</a>.</p>

</div>
</div>
<a class="anchor" id="ae99e8745fc02ffac2cfdb431951eeabf"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::search_and_reconstruct </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a> *&#160;</td>
          <td class="paramname"><em>labels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>recons</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Similar to search, but also reconstructs the stored vectors (or an approximation in the case of lossy coding) for the search results.</p>
<p>If there are not enough results for a query, the resulting array is padded with -1s.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">recons</td><td>reconstructed vectors size (n, k, d) </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#a75260a5d45fb24a9a3c3462786f1de4d">faiss::IndexBinaryIVF</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00053">53</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a34b7f0f358259d858135555967c6bc79"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::IndexBinary::train </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfaiss_1_1IndexBinary.html#a01749bbdbd3b7ec6bb9390257ab16c5c">idx_t</a>&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>x</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Perform training on a representative set of vectors.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>nb of training vectors </td></tr>
    <tr><td class="paramname">x</td><td>training vecors, size n * d / 8 </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented in <a class="el" href="structfaiss_1_1IndexBinaryIVF.html#a4b4b1ba42e6af7c30ccbaf0fc0f38034">faiss::IndexBinaryIVF</a>, <a class="el" href="structfaiss_1_1IndexBinaryFromFloat.html#a7de4bb8e82f0dae621c87b44cfb64404">faiss::IndexBinaryFromFloat</a>, and <a class="el" href="structfaiss_1_1IndexBinaryHNSW.html#afc2793b3b3c53e5acd8315dfea500e68">faiss::IndexBinaryHNSW</a>.</p>

<p>Definition at line <a class="el" href="IndexBinary_8cpp_source.html#l00019">19</a> of file <a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>/data/users/hoss/faiss/<a class="el" href="IndexBinary_8h_source.html">IndexBinary.h</a></li>
<li>/data/users/hoss/faiss/<a class="el" href="IndexBinary_8cpp_source.html">IndexBinary.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
